<template>
  <j-modal
    :title="title"
    :width="800"
    :visible="visible"
    :maskClosable="false"
    :ok-button-props="{ props: { disabled: disableSubmit } }"
    :fullscreen="true"
    @close="close"
    cancelText="关闭">
    <div :class="{isCheck:isCheck}">
      <div class="table-header">
        <span class="table-title">填报单位：</span>{{model.departName}}
        <span class="table-title">审计负责人：</span>{{model.auditPersonName}}
        <span class="table-title">填表人：</span>{{model.createByText}}
        <span class="table-title">填表时间：</span>{{model.createTime}}
        <span class="table-title">统计时间：</span>{{model.year}}年（{{model.quarter}}季度）
      </div>
      <a-table
        class="edit-list"
        ref="table"
        size="middle"
        bordered
        width="100vw"
        :pagination="false"
        :columns="columns"
        :dataSource="dataSource"
        :scroll="{x:250, y: 700 }">
        <template slot="name" slot-scope="name">
          <div style="width: 100%;height: 45px;overflow-x: hidden; overflow-y: auto;">{{name}}</div>
        </template>
      </a-table>
      <FileTag :apiId="apiId"></FileTag>
    </div>
  </j-modal>
</template>
<script>
  import {httpAction, getAction} from '@/api/manage'
  import columns from "./columns"
  import FileTag from "../../components/FileTag"

  export default {
    name: 'CheckAndEditModel',
    components: {
      FileTag
    },
    data() {
      return {
        disableSubmit: false,
        columns: columns(this),
        dataSource: [],
        title: '',
        visible: false,
        isCheck: false,
        apiId: '',
        model: {}
      }
    },
    created() {
    },
    methods: {
      check(record) {
        this.model = Object.assign({}, record)
        this.dataSource = JSON.parse(this.model.reportInfo)
        this.apiId = this.model['fileId']
        this.visible = true
      },
      close(isSubmit) {
        if (isSubmit) {
        } else {
          this.visible = false
        }
      },
    }
  }
</script>

<style lang="less" scoped>
  @import '../../css/checkAndEdit.less';

  .table-header {
    margin-bottom: 10px;

    .table-title {
      font-weight: bold;
      margin-left: 15px;
    }
  }


</style>
